//
//  Person.m
//  练习
//
//  Created by dllo on 16/2/25.
//  Copyright © 2016年 Apon. All rights reserved.
//

#import "Person.h"

@implementation Person
-(void)setName:(NSString *)name{
    _name = name;

}
-(NSString *)name{
    return _name;
}

-(void)setSex:(NSString *)sex{
    _sex = sex;
}
-(NSString *)sex{
    return _sex;
}

-(void)setAge:(NSInteger)age{
    _age =age;
}
-(NSInteger)age{
    return _age;
}

- (void)sayHi{
    NSLog(@"name:%@,sex:%@,age:%ld",_name,_sex,_age);
}

-(instancetype)initWithAge:(NSInteger)age{
    self =[super init];
    if (self) {
        _age =age;
    }
    return self;
}

+(id)personWithSex:(NSString * )sex{

    return [[Person alloc]initWithSex:sex];

}














@end
